home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 93-12.Z / 93-12 / 000002_paul@atlas.dev.abccomp.oz.au_Tue Dec 14 12:45:34 1993.msg < prev    next >
Internet Message Format  |  1993-12-30  |  20KB

  1. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  2.    From dob@tis.inel.gov Tue Dec 14 01:12:44 1993
  3. Received: from mica.inel.gov by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  4.           id AA10511; Tue, 14 Dec 1993 10:12:17 -0500
  5. Received: from dewey.inel.gov (dewey.tis.inel.gov) by mica.inel.gov
  6.     (4.1/INEL-MH-10.0) id AA01804; Tue, 14 Dec 93 08:11:51 MST
  7. Received: by dewey.inel.gov (5.65/INEL-WKS-2.0)
  8.     id AA06191; Tue, 14 Dec 1993 08:12:44 -0700
  9. Date: Tue, 14 Dec 1993 08:12:44 -0700
  10. From: dob@tis.inel.gov (Dave Brooks)
  11. Message-Id: <9312141512.AA06191@dewey.inel.gov>
  12. To: paul@atlas.abccomp.oz.au, winsock-hackers@sunsite.unc.edu
  13. Subject: action on connection to full listening queue
  14. In-Reply-To: <9312140645.AA24607@atlas>
  15. References: <9312140645.AA24607@atlas>
  16.  
  17. paul@atlas.abccomp.oz.au writes:
  18.  > I've been on BSD-patrol again trying to reconcile some small differences in
  19.  > described bahaviour, and call for comments on this one:
  20.  
  21. Good deal, Paul.
  22.  
  23.  > The Windows Sockets spec states that when a connection attempt arrives for
  24.  > a socket which is listening, and has filled its backlog, the connection
  25.  > attempt will be returned, and the connecting socket will return
  26.  > error WSAECONNREFUSED.
  27.  >     The man-page for listen on our SunOS 4.1 box says the same thing.
  28.  > 
  29.  >     The document "An Advanced Socket-Based Interprocess Communications
  30.  > Tutorial" from Sun, however, states:
  31.  
  32.  > [ alternative behavior deleted]
  33.  
  34.  > My gut feel tells me the man-page and Windows Sockets description are
  35.  > the appropriate way to go, although I can see merit in the alternative
  36.  > behaviour.
  37.  > 
  38.  >     The question is, which is the "correct" bahaviour, according to
  39.  > Berkeley Sockets tradition?
  40.  
  41. There is merit in the alternative, but it's not "correct" according to the
  42. WinSock spec or my understanding and experience with the BSD tradition.
  43.  
  44. OTOH, I've never seen a user respond positively to a "failure to connect".
  45.  
  46. Dave
  47. From ed@odi.com Tue Dec 14 06:10:00 1993
  48. Received: from mineshaft.odi.com by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  49.           id AA17457; Tue, 14 Dec 1993 11:10:14 -0500
  50. Received: from odi.com (kayak.odi.com) by mineshaft.odi.com (5.65c/SMI-4.0/ODI-5)
  51.     id AA12556; Tue, 14 Dec 1993 11:10:01 -0500
  52. Return-Path: <ed@odi.com>
  53. Received: by odi.com (4.1/SMI-4.0/ODI-15)
  54.     id AA29535; Tue, 14 Dec 93 11:10:00 EST
  55. Date: Tue, 14 Dec 93 11:10:00 EST
  56. From: Ed Schwalenberg <ed@odi.com>
  57. Message-Id: <9312141610.AA29535@odi.com>
  58. To: dob@tis.inel.gov
  59. Cc: winsock-hackers@sunsite.unc.edu
  60. In-Reply-To: Dave Brooks's message of Tue, 14 Dec 1993 10:14:33 -0500 <9312141512.AA06191@dewey.inel.gov>
  61. Subject: action on connection to full listening queue
  62.  
  63.   Date: Tue, 14 Dec 1993 10:14:33 -0500
  64.   From: dob@tis.inel.gov (Dave Brooks)
  65.  
  66.    > The Windows Sockets spec states that when a connection attempt arrives for
  67.    > a socket which is listening, and has filled its backlog, the connection
  68.    > attempt will be returned, and the connecting socket will return
  69.    > error WSAECONNREFUSED.
  70.    >     The man-page for listen on our SunOS 4.1 box says the same thing.
  71.  
  72.   OTOH, I've never seen a user respond positively to a "failure to connect".
  73.  
  74. Indeed.  On the other hand, if an operating system kernel or a Windows Sockets
  75. implementation were to use up infinite resources in an attempt to queue up
  76. an infinite number of connections, the user at the listening end would probably
  77. be just as unhappy as his peer who's attempting to connect.
  78. That's why listen() has a backlog argument.
  79.  
  80. What I don't understand is why certain operating systems think that 5 is
  81. an acceptable number for the maximum possible backlog.  Virtually every
  82. customer we've ever had stress-tests our client-server database product by
  83. starting up a zillion simultaneous clients; on the operating systems in
  84. question some number of clients fail because our attempt to do listen(x, 100)
  85. failed.
  86. From davidtr@microsoft.com Tue Dec 14 02:12:00 1993
  87. Received: from netmail.microsoft.com ([131.107.1.13]) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  88.           id AA15315; Tue, 14 Dec 1993 14:39:11 -0500
  89. Received:  by netmail.microsoft.com (5.65/25-eef)
  90.     id AA11351; Tue, 14 Dec 93 11:39:36 -0800
  91. Message-Id: <9312141812.AA02663@itgmsm>
  92. From: davidtr@microsoft.com
  93. To: winsock-hackers@SunSITE.Unc.EDU
  94. Subject: RE: action on connection to full listening queue
  95. Date: Tue, 14 Dec 93 10:12:00 PST
  96. X-Mailer: Microsoft Mail V3.0
  97.  
  98.  
  99.  
  100. |From: netmail!paul@atlas.abccomp.oz.au
  101. |
  102. |The Windows Sockets spec states that when a connection attempt arrives for
  103. |a socket which is listening, and has filled its backlog, the connection
  104. |attempt will be returned, and the connecting socket will return
  105. |error WSAECONNREFUSED.
  106. |        The man-page for listen on our SunOS 4.1 box says the same thing.
  107. |
  108. |        The document "An Advanced Socket-Based Interprocess Communications
  109. |Tutorial" from Sun, however, states:
  110. |        "Should a connection be requested while the queue is full, the
  111. |conection will not be refused, but rather the individual messages that
  112. |comprise the request will be ignored. This gives the harried server time
  113. |to make room in its pending connection queue while the client retries the
  114. |connection request. Had the connection been returned with the ECONNREFUSED
  115. |error, the client would be unable to tell if the server was up or not."
  116. |
  117. |My gut feel tells me the man-page and Windows Sockets description are
  118. |the appropriate way to go, although I can see merit in the alternative
  119. |behaviour.
  120. |
  121. |        The question is, which is the "correct" bahaviour, according to
  122. |Berkeley Sockets tradition?
  123.  
  124. i see this as really a TCP question.  if a host receives a SYN for a 
  125. listening port which has reached the backlog limit, should the host respond 
  126. with a RST or should it ignore the SYN?  i scanned rfcs 793 and 1122 but 
  127. couldn't find an answer for this.  of the implementations i'm aware of, all 
  128. send the RST, but they also retry the SYN in response to a RST to smooth 
  129. over the case where the backlog is full, so the ECONNREFUSED as a result of 
  130. a full backlog is very rare--it would require that the backlog be full for 
  131. an extended period of time.
  132.  
  133. the disadvantage of ignoring the SYN is that the client does not know get 
  134. any acknowledgement that a path to the host exists.
  135.  
  136. davidtr@microsoft.com
  137. From paul@atlas.dev.abccomp.oz.au Wed Dec 15 04:31:18 1993
  138. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  139.           id AA05117; Tue, 14 Dec 1993 17:58:38 -0500
  140. Received: by usage.csd.unsw.OZ.AU id AA16631
  141.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 15 Dec 1993 09:20:53 +1100
  142. Received: by atlas (4.1/1.35)
  143.     id AA27288; Wed, 15 Dec 93 09:31:18 EST
  144. Message-Id: <9312142231.AA27288@atlas>
  145. From: paul@atlas.abccomp.oz.au
  146. Date: Wed, 15 Dec 1993 09:31:18 -0500
  147. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  148. To: ed@odi.com, Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  149. Subject: Re: action on connection to full listening queue
  150.  
  151. Thus expounded Ed Schwalenberg on Dec 14,11:12am:
  152. /--------------------
  153. |  Date: Tue, 14 Dec 1993 10:14:33 -0500
  154. |  From: dob@tis.inel.gov (Dave Brooks)
  155. |
  156. |   > The Windows Sockets spec states that when a connection attempt arrives for
  157. |   > a socket which is listening, and has filled its backlog, the connection
  158. |   > attempt will be returned, and the connecting socket will return
  159. |   > error WSAECONNREFUSED.
  160. |   >     The man-page for listen on our SunOS 4.1 box says the same thing.
  161. |
  162. |  OTOH, I've never seen a user respond positively to a "failure to connect".
  163. |
  164. |What I don't understand is why certain operating systems think that 5 is
  165. |an acceptable number for the maximum possible backlog.  Virtually every
  166. |customer we've ever had stress-tests our client-server database product by
  167. |starting up a zillion simultaneous clients; on the operating systems in
  168. |question some number of clients fail because our attempt to do listen(x, 100)
  169. |failed.
  170.  
  171. Are you re-tranmsitting the SYN despite receiving one or two RST segments,
  172. as the fine print in RFC1122 seems to indicate? (see my reply to David)
  173. This would cause your client to wait a little longer, hopefully getting in when
  174. your server has serviced a couple of the lucky early connections.
  175.  
  176.  
  177. -- 
  178. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  179. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  180. 579 Harris St., Ultimo   |                         |  been superseded.
  181. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  182. From paul@atlas.dev.abccomp.oz.au Wed Dec 15 04:27:12 1993
  183. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  184.           id AA05152; Tue, 14 Dec 1993 17:58:55 -0500
  185. Received: by usage.csd.unsw.OZ.AU id AA16497
  186.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 15 Dec 1993 09:16:45 +1100
  187. Received: by atlas (4.1/1.35)
  188.     id AA27282; Wed, 15 Dec 93 09:27:13 EST
  189. Message-Id: <9312142227.AA27282@atlas>
  190. From: paul@atlas.abccomp.oz.au
  191. Date: Wed, 15 Dec 1993 09:27:12 -0500
  192. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  193. To: davidtr@microsoft.com,
  194.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  195. Subject: RE: action on connection to full listening queue
  196.  
  197. Thus expounded davidtr@microsoft.com on Dec 14, 2:45pm:
  198. /--------------------
  199. ||From: netmail!paul@atlas.abccomp.oz.au
  200. ||
  201. ||The Windows Sockets spec states that when a connection attempt arrives for
  202. ||a socket which is listening, and has filled its backlog, the connection
  203. ||attempt will be returned, and the connecting socket will return
  204. ||error WSAECONNREFUSED.
  205. ||        The man-page for listen on our SunOS 4.1 box says the same thing.
  206. ||
  207. ||        The document "An Advanced Socket-Based Interprocess Communications
  208. ||Tutorial" from Sun, however, states:
  209. ||        "Should a connection be requested while the queue is full, the
  210. ||conection will not be refused, but rather the individual messages that
  211. ||comprise the request will be ignored. This gives the harried server time
  212. ||to make room in its pending connection queue while the client retries the
  213. ||connection request. Had the connection been returned with the ECONNREFUSED
  214. ||error, the client would be unable to tell if the server was up or not."
  215. ||
  216. ||My gut feel tells me the man-page and Windows Sockets description are
  217. ||the appropriate way to go, although I can see merit in the alternative
  218. ||behaviour.
  219. ||
  220. ||        The question is, which is the "correct" bahaviour, according to
  221. ||Berkeley Sockets tradition?
  222. |
  223. |i see this as really a TCP question.  if a host receives a SYN for a 
  224. |listening port which has reached the backlog limit, should the host respond 
  225. |with a RST or should it ignore the SYN?  i scanned rfcs 793 and 1122 but 
  226. |couldn't find an answer for this.  of the implementations i'm aware of, all 
  227. |send the RST
  228.  
  229. I take the view that a listening socket with a backlog of 'x' is just 'x'
  230. sockets waiting for a connection. Since a listening socket automatically
  231. replies and establishes the connection into the fully opened state, it is
  232. no longer 'listening', so when the backlog is full there are no more
  233. passive sockets waiting for a connection, so send a RST just as you
  234. would if you had no listener on the port at all. This I guess is the logic
  235. that causes all implementations to return RST.
  236.  
  237. , but they also retry the SYN in response to a RST to smooth 
  238. |over the case where the backlog is full, so the ECONNREFUSED as a result of 
  239. |a full backlog is very rare--it would require that the backlog be full for 
  240. |an extended period of time.
  241.  
  242. This is actually covered in RFC1122, page 101 I think:
  243.     "An attempt to open a TCP connection could fail with excessive
  244. retransmissions of the SYN segment or by receipt of a RST segment or an
  245. ICMP Port Unreachable. SYN retransmissions MUST be handled in the general
  246. way just described for data re-transmissions..."
  247.  
  248.     which to me basically means a connect() shold keep sending SYNs
  249. even if it keeps getting RST segments back, at least for a reasonable
  250. number of times. In fact, it would make sense to ignore return RSTs for
  251. SYNs in this case, so the re-transmission logic automatically handles
  252. backing off the retransmission interval for the SYN. Just record the fact
  253. that a RST or ICMP Port Unreachable was encountered, so then the SYN
  254. fails with excessive re-transmissions the error code ECONNREFUSED instead
  255. of ETIMEDOUT is returned.
  256.  
  257.     This, of course, leads to exactly the same effect as ignoring
  258. the incoming SYN if the backlog is full, in the hope that the backlog will
  259. clear so that a re-transmitted SYN will be accepted, except for the
  260. fact, as David notes below, that in this case you have no indication
  261. of whether the SYNs reached the target or not when the attempt times out.
  262.  
  263. |the disadvantage of ignoring the SYN is that the client does not know get 
  264. |any acknowledgement that a path to the host exists.
  265. |
  266. |davidtr@microsoft.com
  267. \--------------------- {end}
  268.  
  269.     All these are really TCP implementation questions rather than 
  270. Sockets-related issues, and the guiding principle with Windows Sockets is
  271. to "do unto others what BSD does unto you", so we'll go with the RST
  272. and returning WSAECONNREFUSED as described in the spec. and listen() BSD man-
  273. pages.
  274.  
  275.  
  276. -- 
  277. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  278. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  279. 579 Harris St., Ultimo   |                         |  been superseded.
  280. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  281. From paul@atlas.dev.abccomp.oz.au Wed Dec 15 12:54:11 1993
  282. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  283.           id AA10793; Wed, 15 Dec 1993 01:43:48 -0500
  284. Received: by usage.csd.unsw.OZ.AU id AA04617
  285.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 15 Dec 1993 17:43:35 +1100
  286. Received: by atlas (4.1/1.35)
  287.     id AA29101; Wed, 15 Dec 93 17:54:11 EST
  288. Message-Id: <9312150654.AA29101@atlas>
  289. From: paul@atlas.abccomp.oz.au
  290. Date: Wed, 15 Dec 1993 17:54:11 -0500
  291. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  292. To: winsock-hackers@sunsite.unc.edu
  293. Subject: multiple connect() attempts on a single socket
  294.  
  295. Question: If a connect() attempt fails for some reason after it has sent
  296. network traffic (e.g. failure returns WSAETIMEDOUT or WSAECONNREFUSED),
  297. is it necessary to support multiple subsequent connect() attempts, or
  298. must the socket be closed then re-opened again.
  299.   
  300.  
  301. -- 
  302. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  303. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  304. 579 Harris St., Ultimo   |                         |  been superseded.
  305. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  306. From dave@auspost.com.au Wed Dec 22 21:48:52 1993
  307. Received: from yarrina.connect.com.au by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  308.           id AA13341; Tue, 21 Dec 1993 19:01:12 -0500
  309. Received: by yarrina.connect.com.au with UUCP id AA06157
  310.   (5.67b8/IDA-1.5 for winsock-hackers@sunsite.unc.edu); Wed, 22 Dec 1993 11:01:04 +1100
  311. Received: from dross.auspost.com.au (dross) by guk.auspost.com.au with SMTP id AA25283
  312.   (5.65c/IDA-1.4.4); Wed, 22 Dec 1993 10:53:46 +1100
  313. Received: by dross.auspost.com.au id AA26724
  314.   (5.65c/IDA-1.4.4); Wed, 22 Dec 1993 10:48:52 +1100
  315. Date: Wed, 22 Dec 1993 10:48:52 +1100
  316. From: Dave Cole <dave@auspost.com.au>
  317. Message-Id: <199312212348.AA26724@dross.auspost.com.au>
  318. To: paul@atlas.abccomp.oz.au
  319. Cc: winsock-hackers@sunsite.unc.edu
  320. In-Reply-To: <9312212250.AA24350@atlas> (paul@atlas.abccomp.oz.au)
  321. Subject: Re: non-blocking connect() timeout after program exits
  322.  
  323. > How are you making the socket non-blocking - using ioctlsocket() or
  324. > WSAAsyncSelect() - and if the latter, you could try calling
  325. > WSAAsyncSelect with an argument lEvent=0L to cancel your interest
  326. > in asynchronous events before closing the socket. You shouldn't
  327. > have to do this, but it might get you going until the stack
  328. > is fixed.
  329.  
  330. I never thought of making the socket non-blocking by using
  331. WSAAsyncSelect()...  I wonder...
  332.  
  333. I will be a bit annoyed if the stack is able to cancel the connect if
  334. I use WSAAsyncSelect() but not if I use ioctlsocket().
  335.  
  336. Thanks for your suggestion.
  337.  
  338. - Dave
  339. From paul@atlas.dev.abccomp.oz.au Wed Dec 22 04:50:06 1993
  340. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  341.           id AA16999; Tue, 21 Dec 1993 19:59:52 -0500
  342. Received: by usage.csd.unsw.OZ.AU id AA29715
  343.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 22 Dec 1993 10:25:05 +1100
  344. Received: by atlas (4.1/1.35)
  345.     id AA24350; Wed, 22 Dec 93 09:50:06 EST
  346. Date: Wed, 22 Dec 93 09:50:06 EST
  347. From: paul@atlas.abccomp.oz.au (Paul Brooks)
  348. Message-Id: <9312212250.AA24350@atlas>
  349. To: dave@auspost.com.au, winsock-hackers@sunsite.unc.edu
  350. Subject: Re: non-blocking connect() timeout after program exits
  351. Newsgroups: alt.winsock
  352. In-Reply-To: <DAVE.93Dec20173428@dross.auspost.com.au>
  353. Organization: TurboSoft Pty Ltd, Sydney, Australia
  354.  
  355. In article <DAVE.93Dec20173428@dross.auspost.com.au> you write:
  356. |My setup: Windows 4 Workgroups TCP/IP
  357. |
  358. |My problem: I create a non-bocking socket, the fire off a connect to
  359. |the unix based server.  if the server is not running on the unix box,
  360. |the connect times out.  If I exit my program, before the timeout,
  361. |going though all of the required shutdown; when the connect() times
  362. |out, I am dumped back at the DOS prompt.
  363. |
  364. |Has anyone else seen this?
  365.  
  366. How are you making the socket non-blocking - using ioctlsocket() or
  367. WSAAsyncSelect() - and if the latter, you could try calling
  368. WSAAsyncSelect with an argument lEvent=0L to cancel your interest
  369. in asynchronous events before closing the socket. You shouldn't
  370. have to do this, but it might get you going until the stack
  371. is fixed.
  372.  
  373. -- 
  374. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  375. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  376. 579 Harris St., Ultimo   |                         |  been superseded.
  377. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  378. From junodj@gordon-css583.army.mil Thu Dec 30 13:36:18 1993
  379. Received: from gordon-css583.army.mil ([192.108.177.3]) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  380.           id AA02487; Thu, 30 Dec 1993 18:45:08 -0500
  381. Message-Id: <199312302345.AA02487@SunSITE.Unc.EDU>
  382. Date:     Thu, 30 Dec 93 18:36:18 EST
  383. From: MSG Junod John <junodj@gordon-css583.army.mil>
  384. To: winsock-hackers@sunsite.unc.edu
  385. Subject:  connect timeout
  386.  
  387. Maybe this has been covered before, but how do you increase the timeout
  388. on a "connect" call?  Is there a standard way in winsock to do this?
  389.  
  390. John
  391. From nervmaster.pad@sni.de Thu Dec 30 19:01:37 1993
  392. Received: from mail.sni.de (news.sni.de) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  393.           id AA04076; Thu, 30 Dec 1993 19:01:37 -0500
  394. Message-Id: <199312310001.AA04076@SunSITE.Unc.EDU>
  395. Received: from sni.de by mail.sni.de id <02091-0@mail.sni.de>;
  396.           Fri, 31 Dec 1993 01:00:51 +0100
  397. Subject: Cannot mail to harms.pad.
  398. To: winsock-hackers@SunSITE.Unc.edu
  399. Date: Fri, 31 Dec 93 1:01:19 MET
  400. From: George Turnbull <nervmaster.pade@sni.de>
  401. X-Mailer: xmail 2.4 (based on ELM 2.2 PL16)
  402.  
  403.  
  404. Cannot mail to harms.pad, empty mail.
  405.  
  406. -----------------  Unsent message follows:  -------------------------